package com.example.travelplan.app;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.util.SparseBooleanArray;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.Toast;

import com.example.travelplan.app.dominio.Controller;
import com.example.travelplan.app.dominio.TipoLugar;

import java.util.ArrayList;
import java.util.List;

import static android.app.AlertDialog.*;
import static android.view.View.OnClickListener;


/**
 * Created by Rodrigo on 18/06/2014.
 */
public class janelaMensagemEmailActivity extends Activity {

    private ListView atividades;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mesagememail);
        getActionBar().hide();

        int current = getRequestedOrientation();
        // only switch the orientation if not in portrait
        if ( current != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT ) {
            setRequestedOrientation( ActivityInfo.SCREEN_ORIENTATION_PORTRAIT );
        }

        configurarAcoesBotoes();

    }

    private void configurarAcoesBotoes()
    {
        Button bt_cancelar = (Button)findViewById(R.id.bt_cancelar);
        final Intent intentcancelar = new Intent(this, FullscreenActivity.class);
        bt_cancelar.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                Bundle b = new Bundle();
                b.putInt("idTab", 4);
                intentcancelar.putExtras(b);
                startActivity(intentcancelar);
            }
        });

        Button bt_enviar = (Button)findViewById(R.id.bt_enviar);
        final Builder dlgAlert  = new Builder(this);
        bt_enviar.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
            /*    dlgAlert.setMessage("Obrigado por enviar sua mensagem.");
                dlgAlert.setTitle("Mensagem enviada com sucesso!");
                dlgAlert.setPositiveButton("OK", null);
                dlgAlert.setCancelable(true);
                dlgAlert.show();

                dlgAlert.setPositiveButton("Ok",
                        new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int which) {

                            }
                        }
                );
*/
                Toast.makeText(getApplicationContext(), "Mensagem enviada com sucesso!",
                        Toast.LENGTH_LONG).show();

                Bundle b = new Bundle();
                b.putInt("idTab", 4);
                intentcancelar.putExtras(b);
                startActivity(intentcancelar);

            }
        });


    }


}
